Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS2 port #48

Closed
wants to merge 11 commits into from
Closed

ROS2 port #48

wants to merge 11 commits into from

Conversation

mlautman
Copy link

This ports srdfdom to ROS2. Both python and C++ tests pass

@mlautman
Copy link
Author

This was based on #45 by @vmayoral

@mlautman
Copy link
Author

@rhaschke

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot judge this PR. I'm not an expert for ROS 2.
I suggest to split reformatting from actual changes. Right now, it's hard to review this PR at all.
Travis is not yet succeeding.

test/test.py Outdated
self.assertTrue( xml_matches(robot.to_xml_string(False),expected))


# def test_simple_srdf(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why disabling this test?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this. I restored it

def test_complex_srdf(self):
datadir=rospkg.RosPack().get_path('srdfdom')+"/test/resources/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains a lot of unnecessary reformatting.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the reformatting is necessary as it is bad style to change indentation mid file. I have refactored my changes so that the whitespace changes are in a separate commit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhaschke is right, this should be in a separate PR

@mlautman mlautman closed this Mar 14, 2019
@mlautman mlautman changed the base branch from ros2 to crystal-devel March 14, 2019 21:30
@mlautman
Copy link
Author

@henningkayser Please review

@mlautman mlautman reopened this Mar 14, 2019
@mlautman mlautman mentioned this pull request Mar 14, 2019
@mlautman
Copy link
Author

@rhaschke

I suggest to split reformatting from actual changes. Right now, it's hard to review this PR at all.

I have split up the PR into separate commits for formatting and porting

Travis is not yet succeeding.

This is because moveit_ci is still broken:
The command "docker pull moveit/moveit:crystal-ci" failed with error code 1.

Porting srdfdom is one step in getting moveit_ci ported to ROS2.

@rhaschke
Copy link
Contributor

moveit_ci is still broken

I think, the only thing you need is to provide the corresponding docker container. Didn't you work on that already?

Porting srdfdom is one step in getting moveit_ci ported to ROS2.

srdfdom is completely unrelated to moveit_ci.

@mlautman
Copy link
Author

moveit_ci is still broken

I think, the only thing you need is to provide the corresponding docker container. Didn't you work on that already?

It is a WIP. We realized that quite a few of the dependencies (eg srdfdom) weren't building correctly so we are porting them now.

Porting srdfdom is one step in getting moveit_ci ported to ROS2.

srdfdom is completely unrelated to moveit_ci.

Not exactly. The travis.yml for srdfdom clones moveit_ci and runs travis.sh from that repo. Porting everything is going to be kind of a chicken and the egg problem so we choose to start with the dependencies

@mlautman
Copy link
Author

@vmayoral Can you give this a quick review?

@rhaschke
Copy link
Contributor

Porting everything is going to be kind of a chicken and the egg problem.

There is a clear dependency chain, isn't it?

  • moveit_ci (which is independent of any particular repo)
  • geometry2, shapes, srdf, urdf, etc.
  • MoveIt

@mlautman
Copy link
Author

mlautman commented Mar 15, 2019

moveit_ci pulls in https://raw.githubusercontent.com/ros-planning/moveit/$ROS_DISTRO-devel/moveit.rosinstall

It also tries do download the docker image for MoveIt which isn't for crystal yet. If we get the base moveit docker image building and update the rosinstall (without CI passing) then the chain will be broken and we'll be all clear to port moveit_ci

@rhaschke
Copy link
Contributor

What is pulled in by moveit_ci is defined in .travis.yml. If you want to break the circle start there.
Another dependency is indeed the docker image. For now, I suggest to remove/disable the wstool call and installing of MoveIt dependencies there as well. This was introduced in the Dockerfile to speed up Travis.
travis.sh itself updates those dependencies as well.

Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix clang. Also rosdep still fails because of urdfdom_py, but I guess this will only be fixed by ros/urdf_parser_py#41

{
srdf::Model s;
urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf");

std::string package_name = "srdfdom";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const or constexpr char[] ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like over-optimization ;-)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with Dave here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with Henning. Adding a const doesn't harm and clearly states that this variable will not be modified.

test/test.py Show resolved Hide resolved
test/test_parser.cpp Outdated Show resolved Hide resolved
@@ -1,3 +0,0 @@
<launch>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that ros2 uses a different test approach, but is the replacement in this PR? I don't see it. If not, I think we should keep this with an in-line TODO (and maybe matching Issue).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ros2 tests the .cpp without needing .test files

def test_complex_srdf(self):
datadir=rospkg.RosPack().get_path('srdfdom')+"/test/resources/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhaschke is right, this should be in a separate PR


TEST(TestCpp, testSimpleUTF)
{
testSimple("nl_NL.UTF-8");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

{
srdf::Model s;
urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf");

std::string package_name = "srdfdom";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like over-optimization ;-)

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, how the new ROS2 approach to integration tests looks like.
The approach you took here, explicitly coding the two environment options in the cpp files, works here, but for more complex scenarios that's not a feasible approach anymore. Sometimes, we need to launch several nodes to perform an integration test...


if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shouldn't be part of a CMakeLists file, but rather defined by the user.

find_package(console_bridge REQUIRED)
find_package(urdfdom_headers REQUIRED)
find_package(urdf REQUIRED)
find_package(tinyxml_vendor REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these *_vendor packages?
You add many new find_packages, but don't use them in include_directories or target_link_libraries.
I don't think they are really needed. Please clean up if possible or better explain.


before_script:
- git clone -q --depth=1 https://github.com/ros-planning/moveit_ci.git .moveit_ci
- git clone -q -b ros2 --depth=1 -b ros2 https://github.com/ros-planning/moveit_ci.git .moveit_ci
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One --branch ros2 is sufficient 😉


<build_depend>boost</build_depend>
<build_depend>cmake_modules</build_depend>
<build_depend>python_cmake_module</build_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake_modules wasn't related to python in ROS1. Do you really need this package? What does it do?

{
srdf::Model s;
urdf::ModelInterfaceSharedPtr u = loadURDF(std::string(TEST_RESOURCE_LOCATION) + "/pr2_desc.urdf");

std::string package_name = "srdfdom";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with Henning. Adding a const doesn't harm and clearly states that this variable will not be modified.

@rhaschke rhaschke closed this Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants